package com.weic.algorithm.order;

import org.junit.Before;
import org.junit.Test;

public class OrderTest {

    MyOrder order;
    int[] arr = {2,5,7,1,2,55,11,57,22};

    @Before
    public void before(){
        order = new MyOrder();
    }

    /**
     * 选择排序测试
     */
    @Test
    public void testSelect(){
        order.selectOrder(arr);
        printArr(arr);
    }

    /**
     * 插入排序测试
     */
    @Test
    public void testInsert(){
        order.insertOrder(arr);
        printArr(arr);
    }

    /**
     * 冒泡排序测试
     */
    @Test
    public void testBubble(){
        order.bubbleOrder(arr);
        printArr(arr);
    }

    private void printArr(int[]  arr){
        for (int i : arr) {
            System.out.print(i+", ");
        }
        System.out.println();
    }
}
